package com.jszc.lottery.common.datatest;

/**
 * 用户可见异常
 */
public class ShowInfoException extends CommonException{
    public ShowInfoException(String message){
        super(message);
    }

    public ShowInfoException(String message, Throwable t){
        super(message,t);
    }

    /**
     * 获得异常内部的ShowInfoException
     * 如果不存在返回空
     */
    public static ShowInfoException getInnerShowInfoException(Throwable ex)
    {
        while (ex != null)
        {
            if(ReflectionUtil.inheritFrom(ex.getClass(),ShowInfoException.class)){
                return (ShowInfoException)ex;
            }
            ex = ex.getCause();
        }
        return null;
    }

    public static boolean isShowException(Throwable ex){
        return getInnerShowInfoException(ex) != null;
    }
}
